Automatic Updates according to Errorprone Maven plugin run - #2
Open
alechulkin wants to merge 20 commits into
Open
Automatic Updates according to Errorprone Maven plugin run#2alechulkin wants to merge 20 commits into
alechulkin wants to merge 20 commits into
Conversation
…vice.java):
{
"type": "class_variable",
"object_names": [
"FIRST_NAMES",
"LAST_NAMES",
"STREET_NAMES",
"CITY_NAMES",
"STATE_NAMES"
],
"full_result": {
"type": "MutablePublicArray",
"code_location": {
"location": "FIRST_NAMES;LAST_NAMES;STREET_NAMES;CITY_NAMES;STATE_NAMES",
"loc_type": "class_variable"
},
"description": "The public static final arrays are mutable, which violates the immutability principle for constants. This can lead to unintended modifications by external clients. Replace these arrays with immutable collections to ensure safety and immutability.",
"code_segment": "public static final String[] FIRST_NAMES = {\"John\", \"Emily\", \"Michael\", \"Sarah\", \"William\", \"Olivia\", \"James\", \"Ava\", \"Robert\", \"Isabella\"};",
"suggested_fix": "Replace the mutable arrays with immutable lists using Collections.unmodifiableList and Arrays.asList. For example: public static final List<String> FIRST_NAMES = Collections.unmodifiableList(Arrays.asList(\"John\", \"Emily\", \"Michael\", \"Sarah\", \"William\", \"Olivia\", \"James\", \"Ava\", \"Robert\", \"Isabella\"));"
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "class_variable",
"object_names": [
"FIRST_NAMES",
"LAST_NAMES",
"STREET_NAMES",
"CITY_NAMES",
"STATE_NAMES"
],
"full_result": {
"type": "MutablePublicArray",
"code_location": {
"location": "FIRST_NAMES;LAST_NAMES;STREET_NAMES;CITY_NAMES;STATE_NAMES",
"loc_type": "class_variable"
},
"description": "The public static final arrays are mutable, which can lead to unintended modifications by external code. This violates the principle of immutability and can cause bugs or security issues. Replace these arrays with immutable collections to ensure they cannot be modified.",
"code_segment": "public static final String[] FIRST_NAMES = {\"John\", \"Emily\", \"Michael\", \"Sarah\", \"William\", \"Olivia\", \"James\", \"Ava\", \"Robert\", \"Isabella\"};\npublic static final String[] LAST_NAMES = {\"Smith\", \"Johnson\", \"Williams\", \"Jones\", \"Brown\", \"Davis\", \"Miller\", \"Wilson\", \"Moore\", \"Taylor\"};\npublic static final String[] STREET_NAMES = {\"Main St\", \"Park Ave\", \"Elm St\", \"Oak St\", \"Maple St\", \"Pine St\", \"Cedar St\", \"Spruce St\", \"Fir St\", \"Cypress St\"};\npublic static final String[] CITY_NAMES = {\"New York\", \"Los Angeles\", \"Chicago\", \"Houston\", \"Phoenix\", \"Philadelphia\", \"San Antonio\", \"San Diego\", \"Dallas\", \"San Jose\"};\npublic static final String[] STATE_NAMES = {\"NY\", \"CA\", \"IL\", \"TX\", \"AZ\", \"PA\", \"TX\", \"CA\", \"TX\", \"CA\"};",
"suggested_fix": "Replace the mutable arrays with immutable lists using `Collections.unmodifiableList`. For example:\n\n```java\npublic static final List<String> FIRST_NAMES = Collections.unmodifiableList(Arrays.asList(\"John\", \"Emily\", \"Michael\", \"Sarah\", \"William\", \"Olivia\", \"James\", \"Ava\", \"Robert\", \"Isabella\"));\npublic static final List<String> LAST_NAMES = Collections.unmodifiableList(Arrays.asList(\"Smith\", \"Johnson\", \"Williams\", \"Jones\", \"Brown\", \"Davis\", \"Miller\", \"Wilson\", \"Moore\", \"Taylor\"));\npublic static final List<String> STREET_NAMES = Collections.unmodifiableList(Arrays.asList(\"Main St\", \"Park Ave\", \"Elm St\", \"Oak St\", \"Maple St\", \"Pine St\", \"Cedar St\", \"Spruce St\", \"Fir St\", \"Cypress St\"));\npublic static final List<String> CITY_NAMES = Collections.unmodifiableList(Arrays.asList(\"New York\", \"Los Angeles\", \"Chicago\", \"Houston\", \"Phoenix\", \"Philadelphia\", \"San Antonio\", \"San Diego\", \"Dallas\", \"San Jose\"));\npublic static final List<String> STATE_NAMES = Collections.unmodifiableList(Arrays.asList(\"NY\", \"CA\", \"IL\", \"TX\", \"AZ\", \"PA\", \"TX\", \"CA\", \"TX\", \"CA\"));\n```"
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "class_variable",
"object_names": [
"STREET_NAMES",
"CITY_NAMES",
"STATE_NAMES"
],
"full_result": {
"type": "MutablePublicArray",
"code_location": {
"loc_type": "class_variable",
"location": "STREET_NAMES;CITY_NAMES;STATE_NAMES"
},
"description": "The public static final arrays STREET_NAMES, CITY_NAMES, and STATE_NAMES are mutable, which can lead to unintended modifications by external code. This violates the principle of immutability for constants.",
"code_segment": "public static final String[] STREET_NAMES = {\"Main St\", \"Park Ave\", \"Elm St\", \"Oak St\", \"Maple St\", \"Pine St\", \"Cedar St\", \"Spruce St\", \"Fir St\", \"Cypress St\"};\npublic static final String[] CITY_NAMES = {\"New York\", \"Los Angeles\", \"Chicago\", \"Houston\", \"Phoenix\", \"Philadelphia\", \"San Antonio\", \"San Diego\", \"Dallas\", \"San Jose\"};\npublic static final String[] STATE_NAMES = {\"NY\", \"CA\", \"IL\", \"TX\", \"AZ\", \"PA\", \"TX\", \"CA\", \"TX\", \"CA\"};",
"suggested_fix": "Replace the mutable arrays with immutable lists using Collections.unmodifiableList and Arrays.asList. For example:\n\npublic static final List<String> STREET_NAMES = Collections.unmodifiableList(Arrays.asList(\"Main St\", \"Park Ave\", \"Elm St\", \"Oak St\", \"Maple St\", \"Pine St\", \"Cedar St\", \"Spruce St\", \"Fir St\", \"Cypress St\"));\npublic static final List<String> CITY_NAMES = Collections.unmodifiableList(Arrays.asList(\"New York\", \"Los Angeles\", \"Chicago\", \"Houston\", \"Phoenix\", \"Philadelphia\", \"San Antonio\", \"San Diego\", \"Dallas\", \"San Jose\"));\npublic static final List<String> STATE_NAMES = Collections.unmodifiableList(Arrays.asList(\"NY\", \"CA\", \"IL\", \"TX\", \"AZ\", \"PA\", \"TX\", \"CA\", \"TX\", \"CA\"));"
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "class_variable",
"object_names": [
"FIRST_NAMES",
"LAST_NAMES",
"STREET_NAMES",
"CITY_NAMES",
"STATE_NAMES"
],
"full_result": {
"type": "MutablePublicArray",
"code_location": {
"location": "FIRST_NAMES;LAST_NAMES;STREET_NAMES;CITY_NAMES;STATE_NAMES",
"loc_type": "class_variable"
},
"description": "The public static final arrays are mutable, which can lead to unintended modifications by external clients. This violates encapsulation and can cause unpredictable behavior. To address this, replace the arrays with immutable lists.",
"code_segment": "public static final String[] FIRST_NAMES = {\"John\", \"Emily\", \"Michael\", \"Sarah\", \"William\", \"Olivia\", \"James\", \"Ava\", \"Robert\", \"Isabella\"};\npublic static final String[] LAST_NAMES = {\"Smith\", \"Johnson\", \"Williams\", \"Jones\", \"Brown\", \"Davis\", \"Miller\", \"Wilson\", \"Moore\", \"Taylor\"};\npublic static final String[] STREET_NAMES = {\"Main St\", \"Park Ave\", \"Elm St\", \"Oak St\", \"Maple St\", \"Pine St\", \"Cedar St\", \"Spruce St\", \"Fir St\", \"Cypress St\"};\npublic static final String[] CITY_NAMES = {\"New York\", \"Los Angeles\", \"Chicago\", \"Houston\", \"Phoenix\", \"Philadelphia\", \"San Antonio\", \"San Diego\", \"Dallas\", \"San Jose\"};\npublic static final String[] STATE_NAMES = {\"NY\", \"CA\", \"IL\", \"TX\", \"AZ\", \"PA\", \"TX\", \"CA\", \"TX\", \"CA\"};",
"suggested_fix": "Replace the mutable arrays with immutable lists using `Collections.unmodifiableList`. For example:\n\n```java\npublic static final List<String> FIRST_NAMES = Collections.unmodifiableList(Arrays.asList(\"John\", \"Emily\", \"Michael\", \"Sarah\", \"William\", \"Olivia\", \"James\", \"Ava\", \"Robert\", \"Isabella\"));\npublic static final List<String> LAST_NAMES = Collections.unmodifiableList(Arrays.asList(\"Smith\", \"Johnson\", \"Williams\", \"Jones\", \"Brown\", \"Davis\", \"Miller\", \"Wilson\", \"Moore\", \"Taylor\"));\npublic static final List<String> STREET_NAMES = Collections.unmodifiableList(Arrays.asList(\"Main St\", \"Park Ave\", \"Elm St\", \"Oak St\", \"Maple St\", \"Pine St\", \"Cedar St\", \"Spruce St\", \"Fir St\", \"Cypress St\"));\npublic static final List<String> CITY_NAMES = Collections.unmodifiableList(Arrays.asList(\"New York\", \"Los Angeles\", \"Chicago\", \"Houston\", \"Phoenix\", \"Philadelphia\", \"San Antonio\", \"San Diego\", \"Dallas\", \"San Jose\"));\npublic static final List<String> STATE_NAMES = Collections.unmodifiableList(Arrays.asList(\"NY\", \"CA\", \"IL\", \"TX\", \"AZ\", \"PA\", \"TX\", \"CA\", \"TX\", \"CA\"));\n```"
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "class_variable",
"object_names": [
"LAST_NAMES"
],
"full_result": {
"type": "MutablePublicArray",
"code_location": {
"loc_type": "class_variable",
"location": "LAST_NAMES"
},
"description": "The LAST_NAMES variable is declared as a public static final List, which is immutable due to Collections.unmodifiableList. However, the ErrorProne plugin suggests that non-empty arrays are mutable and can be modified by clients of this class. To address this, ensure that the list is truly immutable and cannot be modified externally.",
"code_segment": "public static final List<String> LAST_NAMES = Collections.unmodifiableList(Arrays.asList(\"Smith\", \"Johnson\", \"Williams\", \"Jones\", \"Brown\", \"Davis\", \"Miller\", \"Wilson\", \"Moore\", \"Taylor\"));",
"suggested_fix": "Replace the current implementation with an ImmutableList from Google's Guava library or use a private static final List and provide a public accessor method that returns a defensive copy of the list. This ensures that the list cannot be modified externally."
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "class_variable",
"object_names": [
"STREET_NAMES",
"CITY_NAMES",
"STATE_NAMES",
"ZIP_CODES"
],
"full_result": {
"type": "MutablePublicArray",
"code_location": {
"loc_type": "class_variable",
"location": "STREET_NAMES;CITY_NAMES;STATE_NAMES;ZIP_CODES"
},
"description": "The identified lists are declared as public static final, which makes them accessible and modifiable by external classes. This violates encapsulation and can lead to unintended side effects. To address this, the lists should be made private and accessor methods should be provided to return immutable copies of the lists.",
"code_segment": "public static final List<String> STREET_NAMES = List.of(\"Main St\", \"Park Ave\", \"Elm St\", \"Oak St\", \"Maple St\", \"Pine St\", \"Cedar St\", \"Spruce St\", \"Fir St\", \"Cypress St\");\npublic static final List<String> CITY_NAMES = List.of(\"New York\", \"Los Angeles\", \"Chicago\", \"Houston\", \"Phoenix\", \"Philadelphia\", \"San Antonio\", \"San Diego\", \"Dallas\", \"San Jose\");\npublic static final List<String> STATE_NAMES = List.of(\"NY\", \"CA\", \"IL\", \"TX\", \"AZ\", \"PA\", \"TX\", \"CA\", \"TX\", \"CA\");\npublic static final List<String> ZIP_CODES = List.of(\"10001\", \"90001\", \"60001\", \"77001\", \"85001\", \"19101\", \"78201\", \"92101\", \"75201\", \"95101\");",
"suggested_fix": "Change the access modifier of these lists to private and provide public getter methods that return an unmodifiable view of the lists using Collections.unmodifiableList(). For example:\n\nprivate static final List<String> STREET_NAMES = List.of(\"Main St\", \"Park Ave\", \"Elm St\", \"Oak St\", \"Maple St\", \"Pine St\", \"Cedar St\", \"Spruce St\", \"Fir St\", \"Cypress St\");\n\npublic static List<String> getStreetNames() {\n return Collections.unmodifiableList(STREET_NAMES);\n}\n\nRepeat this pattern for CITY_NAMES, STATE_NAMES, and ZIP_CODES."
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "class_variable",
"object_names": [
"COUNTRY_NAMES"
],
"full_result": {
"type": "MutablePublicArray",
"code_location": {
"location": "COUNTRY_NAMES",
"loc_type": "class_variable"
},
"description": "The COUNTRY_NAMES variable is declared as a public static final list, which is mutable. This can lead to unintended modifications by external classes. To ensure immutability, use an unmodifiable list or an immutable collection.",
"code_segment": "public static final List<String> COUNTRY_NAMES = List.of(\"France\", \"US\", \"UK\", \"Tuvalu\", \"Lesotho\", \"Kyrgyzstan\", \"Nepal\", \"Luxembourg\", \"Dominica\", \"Martinica\");",
"suggested_fix": "Replace the declaration with: public static final List<String> COUNTRY_NAMES = Collections.unmodifiableList(List.of(\"France\", \"US\", \"UK\", \"Tuvalu\", \"Lesotho\", \"Kyrgyzstan\", \"Nepal\", \"Luxembourg\", \"Dominica\", \"Martinica\")); This ensures that the list cannot be modified externally."
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "class_variable",
"object_names": [
"COUNTRY_NAMES"
],
"full_result": {
"type": "MutablePublicArray",
"code_location": {
"loc_type": "class_variable",
"location": "COUNTRY_NAMES"
},
"description": "The COUNTRY_NAMES list is declared as public static final, but it is mutable. This violates the principle of immutability and can lead to unintended modifications by external classes.",
"code_segment": "public static final List<String> COUNTRY_NAMES = Collections.unmodifiableList(List.of(\"France\", \"US\", \"UK\", \"Tuvalu\", \"Lesotho\", \"Kyrgyzstan\", \"Nepal\", \"Luxembourg\", \"Dominica\", \"Martinica\"));",
"suggested_fix": "Change the declaration of COUNTRY_NAMES to use an ImmutableList from Guava library or similar. For example: `public static final List<String> COUNTRY_NAMES = ImmutableList.of(\"France\", \"US\", \"UK\", \"Tuvalu\", \"Lesotho\", \"Kyrgyzstan\", \"Nepal\", \"Luxembourg\", \"Dominica\", \"Martinica\");`. This ensures true immutability."
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "class_variable",
"object_names": [
"STATE_NAMES"
],
"full_result": {
"type": "MutablePublicArray",
"code_location": {
"loc_type": "class_variable",
"location": "STATE_NAMES"
},
"description": "The STATE_NAMES list is declared as private static final, but it is mutable. This violates the principle of immutability and can lead to unintended modifications within the class.",
"code_segment": "private static final List<String> STATE_NAMES = List.of(\"NY\", \"CA\", \"IL\", \"TX\", \"AZ\", \"PA\", \"TX\", \"CA\", \"TX\", \"CA\");",
"suggested_fix": "Change the declaration of STATE_NAMES to use an ImmutableList from Guava library or similar. For example: `private static final List<String> STATE_NAMES = ImmutableList.of(\"NY\", \"CA\", \"IL\", \"TX\", \"AZ\", \"PA\", \"TX\", \"CA\", \"TX\", \"CA\");`. This ensures true immutability."
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "method",
"object_names": [
"setJobInfoAndReturn"
],
"full_result": {
"type": "StringCaseLocaleUsage",
"code_location": {
"location": "setJobInfoAndReturn",
"loc_type": "method"
},
"description": "The method setJobInfoAndReturn uses String#toLowerCase without specifying a Locale, which can lead to unexpected behavior in certain locales. For example, the Turkish locale treats the letter 'i' differently, which can cause issues when converting strings to lowercase. To ensure consistent behavior across all locales, specify a Locale explicitly when calling String#toLowerCase.",
"code_segment": "jobInfo.setEmail(employee.getFirstName().toLowerCase() + \".\" + employee.getLastName().toLowerCase() + \"@em.com\");",
"suggested_fix": "Update the code to explicitly specify a Locale when calling String#toLowerCase. For example: jobInfo.setEmail(employee.getFirstName().toLowerCase(Locale.ROOT) + \".\" + employee.getLastName().toLowerCase(Locale.ROOT) + \"@em.com\");"
},
"sonarqube_issue_id": null
}
…vice.java):
{
"type": "method",
"object_names": [
"setJobInfoAndReturn"
],
"full_result": {
"type": "error handling",
"code_location": {
"location": "setJobInfoAndReturn",
"loc_type": "method"
},
"description": "The method uses LocalDate.now() without specifying a time zone, which can lead to inconsistent behavior across different environments. This is flagged by ErrorProne as it silently uses the system default time-zone.",
"code_segment": "jobInfo.setHireDate(LocalDate.now());",
"suggested_fix": "Replace 'LocalDate.now()' with 'LocalDate.now(ZoneId.systemDefault())' to explicitly specify the time zone. This ensures consistent behavior regardless of the system's default time zone."
},
"sonarqube_issue_id": null
}
{
"type": "class_variable",
"object_names": [
"LOGGER"
],
"full_result": {
"type": "code simplification",
"code_location": {
"loc_type": "class_variable",
"location": "LOGGER"
},
"description": "The LOGGER variable is declared but never used in the code. This is flagged by Errorprone as an unused variable. Since the LOG variable is already being used for logging, the LOGGER variable is redundant and should be removed.",
"code_segment": "private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(LeaveUtils.class);",
"suggested_fix": "Remove the LOGGER variable declaration from the class as it is not used anywhere in the code."
},
"sonarqube_issue_id": null
}
{
"type": "method",
"object_names": [
"getRandomStatus"
],
"full_result": {
"type": "EnumOrdinal",
"code_location": {
"location": "getRandomStatus",
"loc_type": "method"
},
"description": "The use of Enum.ordinal() or depending on enum values by index is error-prone because it relies on the order of enum constants, which can change if the enum is modified. Instead, use a more robust approach to randomly select an enum value.",
"code_segment": "Status result = Status.values()[RANDOM.nextInt(Status.values().length)];",
"suggested_fix": "Instead of relying on the ordinal/index of the enum, use a List to store the enum values and randomly select an element from the list. This ensures that the code does not break if the order of the enum constants changes. Example: List<Status> statuses = Arrays.asList(Status.values()); Status result = statuses.get(RANDOM.nextInt(statuses.size()));"
},
"sonarqube_issue_id": null
}
…e.java):
{
"type": "method",
"object_names": [
"capture"
],
"full_result": {
"type": "simplification",
"code_location": {
"location": "capture",
"loc_type": "method"
},
"description": "The code uses `EnumMap.SimpleEntry` which is not the canonical name for the type. This can be misleading and is flagged by Errorprone. Replace it with `AbstractMap.SimpleEntry` which is the canonical name for the type.",
"code_segment": "return new EnumMap.SimpleEntry<>(leave, balance - leaveDays);",
"suggested_fix": "Replace `EnumMap.SimpleEntry` with `AbstractMap.SimpleEntry` to ensure the canonical name is used. This improves code readability and avoids confusion. The corrected line should be: `return new AbstractMap.SimpleEntry<>(leave, balance - leaveDays);`."
},
"sonarqube_issue_id": null
}
….java):
{
"type": "method",
"object_names": [
"addUsersWithRole"
],
"full_result": {
"type": "error handling",
"code_location": {
"location": "addUsersWithRole",
"loc_type": "method"
},
"description": "The code does not specify a locale when calling `String#toLowerCase`. This can lead to unexpected behavior in certain locales where the case conversion rules differ. For example, the Turkish locale has different rules for upper and lower case conversion.",
"code_segment": "LOG.info(\"Added {}/{} {}s...\", addedCount, count, role.name().toLowerCase());",
"suggested_fix": "Specify a locale explicitly when calling `String#toLowerCase`. Use `Locale.ROOT` for a locale-independent result, or `Locale.getDefault()` if the conversion should depend on the system's default locale. For example: `role.name().toLowerCase(Locale.ROOT)`."
},
"sonarqube_issue_id": null
}
…ovider.java):
{
"type": "method",
"object_names": [
"createToken"
],
"full_result": {
"type": "simplification",
"code_location": {
"location": "createToken",
"loc_type": "method"
},
"description": "The createToken method uses Date for issuedAt and expiration fields, which is error-prone due to its outdated API. Replace Date with java.time.Instant for better accuracy and maintainability.",
"code_segment": "Date now = new Date();\nDate validity = new Date(now.getTime() + jwtExpiration);",
"suggested_fix": "Replace the usage of Date with java.time.Instant. Use Instant.now() for the current time and calculate the expiration time using Instant.plusMillis(jwtExpiration). Convert the Instant objects to java.util.Date using Date.from(instant) when setting issuedAt and expiration in the JWT builder."
},
"sonarqube_issue_id": null
}
…ovider.java):
{
"type": "method",
"object_names": [
"validateToken"
],
"full_result": {
"type": "error handling",
"code_location": {
"location": "validateToken",
"loc_type": "method"
},
"description": "The validateToken method uses java.util.Date for expiration validation, which is flagged by Errorprone due to its problematic API. Replace java.util.Date with java.time.Instant for better API usage and to avoid potential bugs.",
"code_segment": "boolean isValid = !claims.getPayload().getExpiration().before(new Date());",
"suggested_fix": "Replace the usage of java.util.Date with java.time.Instant. Extract the expiration date as an Instant and compare it with Instant.now(). This ensures better API usage and avoids potential bugs. Example: boolean isValid = !claims.getPayload().getExpiration().toInstant().isBefore(Instant.now());"
},
"sonarqube_issue_id": null
}
…icationFilter.java):
{
"type": "method",
"object_names": [
"doFilterInternal"
],
"full_result": {
"type": "StringCaseLocaleUsage",
"code_location": {
"location": "doFilterInternal",
"loc_type": "method"
},
"description": "The issue is related to the usage of the `toUpperCase()` method without specifying a `Locale`. This can lead to unexpected behavior in certain locales where the case conversion rules differ. To ensure consistent behavior across all locales, it is recommended to specify a `Locale` explicitly when calling `toUpperCase()`.",
"code_segment": "authorities.add(new SimpleGrantedAuthority(\"ROLE_\" + role.toUpperCase()));",
"suggested_fix": "Replace `role.toUpperCase()` with `role.toUpperCase(Locale.ROOT)` to ensure consistent behavior across all locales. This is the most appropriate fix for ASCII strings, as it avoids locale-specific variations in case conversion."
},
"sonarqube_issue_id": null
}
…Controller.java):
{
"type": "class_variable",
"object_names": [
"APPLICATION_LOGGER"
],
"full_result": {
"type": "code simplification",
"code_location": {
"location": "APPLICATION_LOGGER",
"loc_type": "class_variable"
},
"description": "The APPLICATION_LOGGER variable is declared but never used in the code. It is redundant since the LOG variable is already being used for logging. Remove the APPLICATION_LOGGER variable to simplify the code and avoid confusion.",
"code_segment": "private static final org.slf4j.Logger APPLICATION_LOGGER = org.slf4j.LoggerFactory.getLogger(EmployeeController.class);",
"suggested_fix": "Remove the APPLICATION_LOGGER variable declaration from the class as it is not used anywhere in the code."
},
"sonarqube_issue_id": null
}
…DetailsService.java):
{
"type": "class_variable",
"object_names": [
"LOGGER"
],
"full_result": {
"type": "code simplification",
"code_location": {
"location": "LOGGER",
"loc_type": "class_variable"
},
"description": "The LOGGER variable is declared but never used in the code. The LOG variable is used for logging instead. This creates unnecessary redundancy and confusion.",
"code_segment": "private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(CustomUserDetailsService.class);",
"suggested_fix": "Remove the LOGGER variable declaration as it is unused and redundant. Ensure that the LOG variable is used consistently for logging purposes."
},
"sonarqube_issue_id": null
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please see the commit messages